<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!-- 引入ElementUI样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <!-- 引入ElementUI组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<body>
<div id="app">
    <!--
rules：表单验证规则
-->
    <el-form ref="form" :model="user" :rules="rules" label-width="80px">
        <!--
            prop：（做验证用的，data域中的rules:{username:[{规则一},{规则二},{规则三}],
                                      age:[{规则一},{规则一}]
            }
            ）表单域 model 字段，在使用 validate、resetFields 方法的情况下，该属性是必填的
        -->
        <el-form-item label="用户名" prop="username">
            <el-input v-model="user.username"></el-input>
        </el-form-item>

        <el-form-item label="年龄" prop="age">
            <el-input v-model="user.age"></el-input>
        </el-form-item>


        <el-form-item>
            <el-button type="primary" @click="onSubmit">立即注册</el-button>
        </el-form-item>
    </el-form>

    <script src="js/axios-0.18.0.js"></script>
    <script src="js/user.js"></script>

</div>
</body>
</html>